<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div{
            width: 200px;height: 200px;
            border: 10px solid #000;
            background-color: #000;
            color: #fff;
            

        }
    </style>
</head>
<body>
    <div class="div" onmouseenter="abb()" onmouseleave="add()">
        鼠标移入移除改变样式
    </div>
</body>
<script>
    var divs=document.getElementsByClassName('div')[0]
    function abb(){
        
        divs.style.cssText="background-color:#fff; border-color:red;color:red"
    }
    function add(){
         divs.style.cssText = "background-color:#000; border-color:#000;color:#fff"
    }
</script>
</html>